@extends('app')

@section('content')
<ul class="nav nav-tabs">
    <li class="active"><a href="#">列表</a></li>
</ul>
<div class="panel panel-default mt20">
    <div class="table-responsive panel-body">
        <table class="table table-hover">
          <thead>
            <tr>
              <th>编号</th>
              <th>所属文章</th>
              <th>评论内容</th>
              <th>用户</th>
              <th>回复数</th>
              <th>发布时间</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
          @foreach($result as $res)
            <tr id="news_{{ $res->comment_id }}">
              <td>{{ $res->comment_id }}</td>
              <td> @if(count($res->employ)>0)<a href="{{ url('/employ/'.$res->employ_id) }}">{{ str_limit($res->employ->title,20)}}</a>@else 文章已删除 @endif</td>
              <td><a href="javascript:void(0)"  onclick="showComment('{{$res->content}}')">{{ str_limit($res->content,20) }}</a></td>
              <td>{{getUserName($res->user_id)}}</td>
              <td>{{ $res->childComments->count() }}</td>
              <td>{{ $res->updated_at}}</td>
              <td>
                <a href="javascript:void(0);" onclick="del_one('/admin/employ/comment/delete','{{$res->comment_id}}','{{csrf_token()}}','comment_id')"><i class="glyphicon glyphicon-remove-sign"></i></a>
              </td>
            </tr>
          @endforeach
          </tbody>
        </table>
    </div>
</div>
<div>{!! $result->render() !!} </div>
@endsection

